using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;

namespace PickGold.Generic
{
    public class CTimeslice<TYPE>
    {
        protected TYPE _Value;
        protected DateTime _Timeslice;
        protected DateTime _LastGet;
        protected DateTime _LastSet;
        //
        public CTimeslice()
        {
            this._Value = default(TYPE);
            this._Timeslice = DateTime.MinValue;
            this._LastSet = this._Timeslice;
            this._LastGet = this._Timeslice;
        }
        public CTimeslice(TYPE value) : this()
        {
            this.Value = value;
        }
        //
        public TYPE Value
        {
            set
            {
                this._Timeslice = DateTime.Now;
                this._LastSet = this._Timeslice;
                this._Value = value;
            }
            get
            {
                this._Timeslice = DateTime.Now;
                this._LastGet = this._Timeslice;
                return this._Value;
            }
        }
        //
        public DateTime Timeslice
        {
            get
            {
                return this._Timeslice;
            }
        }
        //
        public DateTime LastSet
        {
            get
            {
                return this._LastSet;
            }
        }
        //
        public DateTime LastGet
        {
            get
            {
                return this._LastGet;
            }
        }
        //
    }
    //
}
//
